<?php


    function inq_fillTab() {
    if ($GLOBALS['l_role'] >= 0) {
        $link = db_connect();
        if ($link) {
            $sql = "SELECT * FROM inq WHERE dateexp >= CURDATE() ORDER BY dateex";
            $result = mysqli_query($link, $sql);
            if ($result) {
                $int = 0;
                while($row = mysqli_fetch_assoc($result)) {
                    $int = $int+1;
                    if ($int % 2 == 0) {
                        echo('<tr class="lichy">');
                    } else {
                        echo('<tr class="sudy">');
                    }
                    $date_parts = preg_split("/[-]/", $row['dateexp']);
                    $date_cor = $date_parts[2].".".$date_parts[1].".".$date_parts[0];
                    echo ("<td>".$row['ID']."</td><td><a href='inq_edit.php?q=".$row['ID']."'>".$row['text']."</a></td><td>".$date_cor."</td>");
                    echo("<td></td><td></td>");
                    echo ("<td><a href='inq_edit.php?q=".$row['ID']."'> edit </a></td>");
                }
            }
        }
    }
}

?>
